/**
 *Author: Jiangtao He; Email: ross.jiangtao.he@gmail.com
 *File Name: MyMain.java
 *Date: 2012-1-19
 *Copyright: All right reserved by author - Jiangtao He
 *Version: MyJavaExpert v1.0
 */
package com.ross.httpdownload;

import com.ross.httpdownload.util.*;

/**
 * Author: Jiangtao He; Email: ross.jiangtao.he@gmail.com
 * Date: 2012-1-19
 * Since: MyJavaExpert v1.0
 * Description: Test the download tool class
 */
public class MyMain
{
    public static void main(String[] args)
    {
        // set system configuration, in real software, it can be configured
        // through GUI, file,etc.
        SysValue.MAX_Num_Of_Thread = 3;
        SysValue.Save_As_Path = "E:/myspace/download/";
        SysValue.Buffer_Size = 1024;
        //file web address
        //String sFileURL = "http://xinsheng-image.huawei.com/cn/forumimage/showimage-991441-20990f56c5b11261fa63e969d8d5580c-self.jpg";
        //String sFileURL = "http://lh5.googleusercontent.com/-F7a0loCDyoQ/AAAAAAAAAAI/AAAAAAAAAFY/TrDxSDdQuhQ/s512-c/photo.jpg";
        //String sFileURL = "http://xinsheng-image.huawei.com/cn/forumimage/showimage-816607-f61c8fe14fc359d49b044376a0956acd-self.jpg";
        //String sFileURL = "http://3.bp.blogspot.com/-oVO24VW8F6M/TxJ9O0opP3I/AAAAAAAAANY/anpu8S4FAC4/s640/100_9223.JPG";
        String sFileURL = "http://hi.csdn.net/attachment/201201/1/0_1325433530Bg5e.gif";
        sFileURL = "http://west263.newhua.com:82/down/jia-audio-converter.zip";
        //file save as name
        String sFileName = sFileURL.substring(sFileURL.lastIndexOf("/") + 1);
       
        // create a object of download tool
        HttpDownloadTool oHttpDownloadTool = new HttpDownloadTool();
        // download the file
        oHttpDownloadTool.download(sFileURL, 3, sFileName);

    }

}
